<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>客户流失分析</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/jquery-easyui-1.8.6/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/jquery-easyui-1.8.6/themes/icon.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.8.6/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.8.6/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.8.6/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/common.js"></script>
</head>
<body style="margin: 1px">
<table id="dg" title="客户流失分析" class="easyui-datagrid" fitColumns="true" pagination="true" rownumbers="true"
       url="${pageContext.request.contextPath}/customerLoss/list.do?state=1" fit="true" toolbar="#dg-tb">
    <thead>
    <tr>
        <th field="cb" checkbox="true" align="center"></th>
        <th field="id" width="50" align="center">编号</th>
        <th field="cusNo" width="50" align="center" hidden="true">客户编号</th>
        <th field="name" width="100" align="center">客户名称</th>
        <th field="cusManager" width="100" align="center">客户经理</th>
        <th field="lastOrderTime" width="100" align="center">上次下单日期</th>
        <th field="confirmLossTime" width="100" align="center">确认流失日期</th>
        <th field="state" width="80" align="center" hidden="true">客户状态</th>
        <th field="lossReason" width="200" align="center">流失原因</th>
    </tr>
    </thead>
</table>
<div id="dg-tb">
    <div>
        &nbsp;客户名称：&nbsp;<input class="easyui-textbox" id="s_cusName" size="20"/>
        &nbsp;客户经理：&nbsp;<input class="easyui-textbox" id="s_cusManager" size="20"/>
        <a href="javascript:searchCustomerLoss()" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
    </div>
</div>

</body>
</html>

<script type="text/javascript">

    $(function () {
        $('#s_cusName,#s_cusManager').each(function (index, element) {
            $(this).textbox('textbox').bind('keydown', function (e) {
                if (e.keyCode == 13) {   // 当按下回车键时接受输入的值。
                    searchCustomerLoss();
                }
            });
        });
    });

    function searchCustomerLoss() {
        $("#dg").datagrid('load', {
            "cusName": $("#s_cusName").val(),
            "cusManager": $("#s_cusManager").val()
        });
    }

</script>